#ifndef __DEVICE_OPERATE_SN_H__
#define __DEVICE_OPERATE_SN_H__
#include <typescommon.h>


#if DEVICE_PLATFORM_CONFIGURE == DEVICE_PLATFORM_LINUX
struct stringPc
{
    uint32_t ssize;
    uint8_t *sdata;
};
int readLocalFile(const char *filepath, char *readbuff, int readsize);
int writeLocalFile(const char *filepath, const char *writebuff, int writesize);
#endif

struct devFileOptStruct
{
    uint8_t fname[8];
    uint32_t fsize;
    uint32_t fcrc;
#if DEVICE_PLATFORM_CONFIGURE == DEVICE_PLATFORM_LINUX
    struct stringPc str;
#endif
};
int devFileWriteBegin(struct devFileOptStruct *devfile, const uint8_t *fname, uint32_t fsize);
int devFileWriteData(struct devFileOptStruct *devfile, uint32_t offset, const uint8_t *fdata, uint32_t dsize);
int devFileWriteEnd(struct devFileOptStruct *devfile, uint32_t dcrc);
int devFileReadData(struct devFileOptStruct *devfile, uint32_t offset, uint8_t *fdata, uint32_t dsize);
struct devFileOptStruct *foptInst();
#endif